<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Net::FTP - FTP Client class - Perldoc Browser</title>
    <link rel="search" href="https://perldoc.perl.org/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser">
    <link rel="canonical" href="https://perldoc.perl.org/Net::FTP">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/stackoverflow-light.min.css" integrity="sha512-cG1IdFxqipi3gqLmksLtuk13C+hBa57a6zpWxMeoY3Q9O6ooFxq50DayCdm0QrDgZjMUn23z/0PMZlgft7Yp5Q==" crossorigin="anonymous" />
    <style>
      body {
        background: #f4f4f5;
        color: #020202;
      }
      .navbar-dark {
        background-image: -webkit-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: -o-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: linear-gradient(to bottom, #005f85 0, #002e49 100%);
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff005f85', endColorstr='#ff002e49', GradientType=0);
        background-repeat: repeat-x;
      }
      .navbar-dark .navbar-nav .nav-link,
      .navbar-dark .navbar-nav .nav-link:focus { color: #fff }
      .navbar-dark .navbar-nav .nav-link:hover { color: #ffef68 }
      #wrapperlicious {
        margin: 0 auto;
        font: 0.9em 'Helvetica Neue', Helvetica, sans-serif;
        font-weight: normal;
        line-height: 1.5em;
        margin: 0;
        padding: 0;
      }
      #wrapperlicious h1 { font-size: 1.5em }
      #wrapperlicious h2 { font-size: 1.3em }
      #wrapperlicious h3 { font-size: 1.1em }
      #wrapperlicious h4 { font-size: 0.9em }
      #wrapperlicious h1, #wrapperlicious h2, #wrapperlicious h3,
      #wrapperlicious h4, #wrapperlicious dt {
        color: #020202;
        margin-top: 1em;
        margin-bottom: 1em;
        position: relative;
        font-weight: bold;
      }
      #wrapperlicious a { color: inherit; text-decoration: underline }
      #wrapperlicious #toc { text-decoration: none }
      #wrapperlicious a:hover { color: #2a2a2a }
      #wrapperlicious a img { border: 0 }
      #wrapperlicious :not(pre) > code {
        color: inherit;
        background-color: rgba(0, 0, 0, 0.04);
        border-radius: 3px;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        padding: 0.3em;
      }
      #wrapperlicious dd {
        margin: 0;
        margin-left: 2em;
      }
      #wrapperlicious dt {
        color: #2a2a2a;
        font-weight: bold;
        margin-left: 0.9em;
      }
      #wrapperlicious p {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious li > p {
        margin-bottom: 0;
        margin-top: 0;
      }
      #wrapperlicious pre {
        border: 1px solid #c1c1c1;
        border-radius: 3px;
        font: 100% Consolas, Menlo, Monaco, monospace;
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious pre > code {
        display: block;
        background-color: #f6f6f6;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        line-height: 1.5em;
        text-align: left;
        white-space: pre;
        padding: 1em;
      }
      #wrapperlicious dl, #wrapperlicious ol, #wrapperlicious ul {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious ul {
        list-style-type: square;
      }
      #wrapperlicious ul ul {
        margin-bottom: 0px;
        margin-top: 0px;
      }
      #footer {
        font-size: 0.8em;
        padding-top: 0.5em;
        text-align: center;
      }
      #more {
        display: inline;
        font-size: 0.8em;
      }
      #perldocdiv {
        background-color: #fff;
        border: 1px solid #c1c1c1;
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
        margin-left: auto;
        margin-right: auto;
        padding: 3em;
        padding-top: 1em;
        max-width: 960px;
      }
      #moduleversion { float: right }
      #wrapperlicious .leading-notice {
        font-style: italic;
        padding-left: 1em;
        margin-top: 1em;
        margin-bottom: 1em;
      }
      #wrapperlicious .permalink {
        display: none;
        left: -0.75em;
        position: absolute;
        padding-right: 0.25em;
        text-decoration: none;
      }
      #wrapperlicious h1:hover .permalink, #wrapperlicious h2:hover .permalink,
      #wrapperlicious h3:hover .permalink, #wrapperlicious h4:hover .permalink,
      #wrapperlicious dt:hover .permalink {
        display: block;
      }
    </style>
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-KVNWBNT5FB"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'G-KVNWBNT5FB');
      gtag('config', 'UA-50555-3');
    </script>
  </head>
  <body>
    <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-between">
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <a class="navbar-brand" href="https://perldoc.perl.org/">Perldoc Browser</a>
  <div class="collapse navbar-collapse" id="navbarNav">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="./Net::FTP.html#" id="dropdownlink-stable" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">5.35.0</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-stable">
          <a class="dropdown-item" href="https://perldoc.perl.org/Net::FTP">Latest</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.2/Net::FTP">5.38.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.1/Net::FTP">5.38.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0/Net::FTP">5.38.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.3/Net::FTP">5.36.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.2/Net::FTP">5.36.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.1/Net::FTP">5.36.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.0/Net::FTP">5.36.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.3/Net::FTP">5.34.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.2/Net::FTP">5.34.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.1/Net::FTP">5.34.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.0/Net::FTP">5.34.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.1/Net::FTP">5.32.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.0/Net::FTP">5.32.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.3/Net::FTP">5.30.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.2/Net::FTP">5.30.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.1/Net::FTP">5.30.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.0/Net::FTP">5.30.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.3/Net::FTP">5.28.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.2/Net::FTP">5.28.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.1/Net::FTP">5.28.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.0/Net::FTP">5.28.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.3/Net::FTP">5.26.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.2/Net::FTP">5.26.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.1/Net::FTP">5.26.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.0/Net::FTP">5.26.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.4/Net::FTP">5.24.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.3/Net::FTP">5.24.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.2/Net::FTP">5.24.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.1/Net::FTP">5.24.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.0/Net::FTP">5.24.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.4/Net::FTP">5.22.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.3/Net::FTP">5.22.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.2/Net::FTP">5.22.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.1/Net::FTP">5.22.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.0/Net::FTP">5.22.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.3/Net::FTP">5.20.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.2/Net::FTP">5.20.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.1/Net::FTP">5.20.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.0/Net::FTP">5.20.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.4/Net::FTP">5.18.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.3/Net::FTP">5.18.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.2/Net::FTP">5.18.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.1/Net::FTP">5.18.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.0/Net::FTP">5.18.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.3/Net::FTP">5.16.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.2/Net::FTP">5.16.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.1/Net::FTP">5.16.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.0/Net::FTP">5.16.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.4/Net::FTP">5.14.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.3/Net::FTP">5.14.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.2/Net::FTP">5.14.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.1/Net::FTP">5.14.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.0/Net::FTP">5.14.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.5/Net::FTP">5.12.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.4/Net::FTP">5.12.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.3/Net::FTP">5.12.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.2/Net::FTP">5.12.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.1/Net::FTP">5.12.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.0/Net::FTP">5.12.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.1/Net::FTP">5.10.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.0/Net::FTP">5.10.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.9/Net::FTP">5.8.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.8/Net::FTP">5.8.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.7/Net::FTP">5.8.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.6/Net::FTP">5.8.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.5/Net::FTP">5.8.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.4/Net::FTP">5.8.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.3/Net::FTP">5.8.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.2/Net::FTP">5.8.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.1/Net::FTP">5.8.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.0/Net::FTP">5.8.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.2/Net::FTP">5.6.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.1/Net::FTP">5.6.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.0/Net::FTP">5.6.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_04/Net::FTP">5.005_04</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_03/Net::FTP">5.005_03</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_02/Net::FTP">5.005_02</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_01/Net::FTP">5.005_01</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005/Net::FTP">5.005</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="./Net::FTP.html#" id="dropdownlink-dev" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dev</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-dev">
          <a class="dropdown-item" href="https://perldoc.perl.org/blead/Net::FTP">blead</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.6/Net::FTP">5.39.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.5/Net::FTP">5.39.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.4/Net::FTP">5.39.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.3/Net::FTP">5.39.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.2/Net::FTP">5.39.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.1/Net::FTP">5.39.1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC2/Net::FTP">5.38.0-RC2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC1/Net::FTP">5.38.0-RC1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.11/Net::FTP">5.37.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.10/Net::FTP">5.37.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.9/Net::FTP">5.37.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.8/Net::FTP">5.37.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.7/Net::FTP">5.37.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.6/Net::FTP">5.37.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.5/Net::FTP">5.37.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.4/Net::FTP">5.37.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.3/Net::FTP">5.37.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.2/Net::FTP">5.37.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.1/Net::FTP">5.37.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.0/Net::FTP">5.37.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.11/Net::FTP">5.35.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.10/Net::FTP">5.35.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.9/Net::FTP">5.35.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.8/Net::FTP">5.35.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.7/Net::FTP">5.35.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.6/Net::FTP">5.35.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.5/Net::FTP">5.35.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.4/Net::FTP">5.35.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.3/Net::FTP">5.35.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.2/Net::FTP">5.35.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.1/Net::FTP">5.35.1</a>
          <a class="dropdown-item active" href="./Net::FTP.html">5.35.0</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="./Net::FTP.html#" id="dropdownlink-nav" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-nav">
          <a class="dropdown-item" href="perl.html">Perl</a>
          <a class="dropdown-item" href="perlintro.html">Intro</a>
          <a class="dropdown-item" href="perl.html#Tutorials">Tutorials</a>
          <a class="dropdown-item" href="perlfaq.html">FAQs</a>
          <a class="dropdown-item" href="perl.html#Reference-Manual">Reference</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlop.html">Operators</a>
          <a class="dropdown-item" href="functions.html">Functions</a>
          <a class="dropdown-item" href="variables.html">Variables</a>
          <a class="dropdown-item" href="modules.html">Modules</a>
          <a class="dropdown-item" href="perlutil.html">Utilities</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlcommunity.html">Community</a>
          <a class="dropdown-item" href="perlhist.html">History</a>
        </div>
      </li>
    </ul>
    <ul class="navbar-nav">
      <script>
        function set_expand (expand) {
          var perldocdiv = document.getElementById('perldocdiv');
          var width = window.getComputedStyle(perldocdiv).getPropertyValue('max-width');
          var expanded = (width == '' || width == 'none') ? true : false;
          if (expand === null) {
            expand = !expanded;
          }
          if ((expand && !expanded) || (!expand && expanded)) {
            perldocdiv.style.setProperty('max-width', expand ? 'none' : '960px');
            var button_classlist = document.getElementById('content-expand-button').classList;
            if (expand) {
              button_classlist.add('btn-light');
              button_classlist.remove('btn-outline-light');
            } else {
              button_classlist.add('btn-outline-light');
              button_classlist.remove('btn-light');
            }
          }
          return expand;
        }
        function toggle_expand () {
          var expand = set_expand(null);
          document.cookie = 'perldoc_expand=' + (expand ? 1 : 0) + '; path=/; expires=Tue, 19 Jan 2038 03:14:07 UTC';
        }
        function read_expand () {
          return document.cookie.split(';').some(function (item) { return item.indexOf('perldoc_expand=1') >= 0 });
        }
        if (document.readyState === 'loading') {
          document.addEventListener('DOMContentLoaded', function () {
            if (read_expand()) {
              set_expand(true);
            }
          });
        } else if (read_expand()) {
          set_expand(true);
        }
      </script>
      <button id="content-expand-button" type="button" class="btn btn-outline-light d-none d-lg-inline-block mr-2" onclick="toggle_expand()">Expand</button>
    <ul>
    <form class="form-inline" method="get" action="https://perldoc.perl.org/5.35.0/search">
      <input class="form-control mr-3" type="search" name="q" placeholder="Search" aria-label="Search">
    </form>
  </div>
</nav>

    <div id="wrapperlicious" class="container-fluid">
      <div id="perldocdiv">
        <div id="links">
          <a href="./Net::FTP.html">Net::FTP</a>
          <div id="more">
            (<a href="./Net::FTP.txt">source</a>,
            <a href="https://metacpan.org/pod/Net::FTP">CPAN</a>)
          </div>
            <div id="moduleversion">version 3.13</div>
        </div>
        <div class="leading-notice">
          You are viewing the version of this documentation from Perl 5.35.0.
            This is a development version of Perl.
        </div>
        <h1><a id="toc">CONTENTS</a></h1>
                  <ul>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#NAME">NAME</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#SYNOPSIS">SYNOPSIS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#DESCRIPTION">DESCRIPTION</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#Overview">Overview</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#Class-Methods">Class Methods</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#Object-Methods">Object Methods</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#Methods-for-the-Adventurous">Methods for the Adventurous</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#The-dataconn-Class">The dataconn Class</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#Unimplemented">Unimplemented</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#EXAMPLES">EXAMPLES</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#EXPORTS">EXPORTS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#KNOWN-BUGS">KNOWN BUGS</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#Reporting-Bugs">Reporting Bugs</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#SEE-ALSO">SEE ALSO</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#ACKNOWLEDGEMENTS">ACKNOWLEDGEMENTS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#AUTHOR">AUTHOR</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#COPYRIGHT">COPYRIGHT</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#LICENCE">LICENCE</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#VERSION">VERSION</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#DATE">DATE</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./Net::FTP.html#HISTORY">HISTORY</a>
              </li>
          </ul>

      <h1 id="NAME"><a class="permalink" href="./Net::FTP.html#NAME">#</a>NAME</h1>

<p>Net::FTP - FTP Client class</p>

<h1 id="SYNOPSIS"><a class="permalink" href="./Net::FTP.html#SYNOPSIS">#</a>SYNOPSIS</h1>

<pre><code>use Net::FTP;

$ftp = Net::FTP-&gt;new(&quot;some.host.name&quot;, Debug =&gt; 0)
  or die &quot;Cannot connect to some.host.name: $@&quot;;

$ftp-&gt;login(&quot;anonymous&quot;,&#39;-anonymous@&#39;)
  or die &quot;Cannot login &quot;, $ftp-&gt;message;

$ftp-&gt;cwd(&quot;/pub&quot;)
  or die &quot;Cannot change working directory &quot;, $ftp-&gt;message;

$ftp-&gt;get(&quot;that.file&quot;)
  or die &quot;get failed &quot;, $ftp-&gt;message;

$ftp-&gt;quit;</code></pre>

<h1 id="DESCRIPTION"><a class="permalink" href="./Net::FTP.html#DESCRIPTION">#</a>DESCRIPTION</h1>

<p><code>Net::FTP</code> is a class implementing a simple FTP client in Perl as described in RFC959. It provides wrappers for the commonly used subset of the RFC959 commands. If <a href="./IO::Socket::IP.html">IO::Socket::IP</a> or <a href="./IO::Socket::INET6.html">IO::Socket::INET6</a> is installed it also provides support for IPv6 as defined in RFC2428. And with <a href="./IO::Socket::SSL.html">IO::Socket::SSL</a> installed it provides support for implicit FTPS and explicit FTPS as defined in RFC4217.</p>

<p>The Net::FTP class is a subclass of Net::Cmd and (depending on avaibility) of IO::Socket::IP, IO::Socket::INET6 or IO::Socket::INET.</p>

<h2 id="Overview"><a class="permalink" href="./Net::FTP.html#Overview">#</a>Overview</h2>

<p>FTP stands for File Transfer Protocol. It is a way of transferring files between networked machines. The protocol defines a client (whose commands are provided by this module) and a server (not implemented in this module). Communication is always initiated by the client, and the server responds with a message and a status code (and sometimes with data).</p>

<p>The FTP protocol allows files to be sent to or fetched from the server. Each transfer involves a <b>local file</b> (on the client) and a <b>remote file</b> (on the server). In this module, the same file name will be used for both local and remote if only one is specified. This means that transferring remote file <code>/path/to/file</code> will try to put that file in <code>/path/to/file</code> locally, unless you specify a local file name.</p>

<p>The protocol also defines several standard <b>translations</b> which the file can undergo during transfer. These are ASCII, EBCDIC, binary, and byte. ASCII is the default type, and indicates that the sender of files will translate the ends of lines to a standard representation which the receiver will then translate back into their local representation. EBCDIC indicates the file being transferred is in EBCDIC format. Binary (also known as image) format sends the data as a contiguous bit stream. Byte format transfers the data as bytes, the values of which remain the same regardless of differences in byte size between the two machines (in theory - in practice you should only use this if you really know what you&#39;re doing). This class does not support the EBCDIC or byte formats, and will default to binary instead if they are attempted.</p>

<h2 id="Class-Methods"><a class="permalink" href="./Net::FTP.html#Class-Methods">#</a><a id="Class"></a>Class Methods</h2>

<dl>

<dt id="new([$host][,-%options])"><a class="permalink" href="./Net::FTP.html#new(%5B$host%5D%5B,-%25options%5D)">#</a><a id="new"></a><a id="new-host-options"></a><code>new([$host][, %options])</code></dt>
<dd>

<p>This is the constructor for a new Net::FTP object. <code>$host</code> is the name of the remote host to which an FTP connection is required.</p>

<p><code>$host</code> is optional. If <code>$host</code> is not given then it may instead be passed as the <code>Host</code> option described below.</p>

<p><code>%options</code> are passed in a hash like fashion, using key and value pairs. Possible options are:</p>

<p><b>Host</b> - FTP host to connect to. It may be a single scalar, as defined for the <code>PeerAddr</code> option in <a href="./IO::Socket::INET.html">IO::Socket::INET</a>, or a reference to an array with hosts to try in turn. The <a href="./Net::FTP.html#host">&quot;host&quot;</a> method will return the value which was used to connect to the host.</p>

<p><b>Firewall</b> - The name of a machine which acts as an FTP firewall. This can be overridden by an environment variable <code>FTP_FIREWALL</code>. If specified, and the given host cannot be directly connected to, then the connection is made to the firewall machine and the string <code>@hostname</code> is appended to the login identifier. This kind of setup is also referred to as an ftp proxy.</p>

<p><b>FirewallType</b> - The type of firewall running on the machine indicated by <b>Firewall</b>. This can be overridden by an environment variable <code>FTP_FIREWALL_TYPE</code>. For a list of permissible types, see the description of ftp_firewall_type in <a href="./Net::Config.html">Net::Config</a>.</p>

<p><b>BlockSize</b> - This is the block size that Net::FTP will use when doing transfers. (defaults to 10240)</p>

<p><b>Port</b> - The port number to connect to on the remote machine for the FTP connection</p>

<p><b>SSL</b> - If the connection should be done from start with SSL, contrary to later upgrade with <code>starttls</code>.</p>

<p><b>SSL_*</b> - SSL arguments which will be applied when upgrading the control or data connection to SSL. You can use SSL arguments as documented in <a href="./IO::Socket::SSL.html">IO::Socket::SSL</a>, but it will usually use the right arguments already.</p>

<p><b>Timeout</b> - Set a timeout value in seconds (defaults to 120)</p>

<p><b>Debug</b> - debug level (see the debug method in <a href="./Net::Cmd.html">Net::Cmd</a>)</p>

<p><b>Passive</b> - If set to a non-zero value then all data transfers will be done using passive mode. If set to zero then data transfers will be done using active mode. If the machine is connected to the Internet directly, both passive and active mode should work equally well. Behind most firewall and NAT configurations passive mode has a better chance of working. However, in some rare firewall configurations, active mode actually works when passive mode doesn&#39;t. Some really old FTP servers might not implement passive transfers. If not specified, then the transfer mode is set by the environment variable <code>FTP_PASSIVE</code> or if that one is not set by the settings done by the <i>libnetcfg</i> utility. If none of these apply then passive mode is used.</p>

<p><b>Hash</b> - If given a reference to a file handle (e.g., <code>\*STDERR</code>), print hash marks (#) on that filehandle every 1024 bytes. This simply invokes the <code>hash()</code> method for you, so that hash marks are displayed for all transfers. You can, of course, call <code>hash()</code> explicitly whenever you&#39;d like.</p>

<p><b>LocalAddr</b> - Local address to use for all socket connections. This argument will be passed to the super class, i.e. <a href="./IO::Socket::INET.html">IO::Socket::INET</a> or <a href="./IO::Socket::IP.html">IO::Socket::IP</a>.</p>

<p><b>Domain</b> - Domain to use, i.e. AF_INET or AF_INET6. This argument will be passed to the IO::Socket super class. This can be used to enforce IPv4 even with <a href="./IO::Socket::IP.html">IO::Socket::IP</a> which would default to IPv6. <b>Family</b> is accepted as alternative name for <b>Domain</b>.</p>

<p>If the constructor fails undef will be returned and an error message will be in $@</p>

</dd>
</dl>

<h2 id="Object-Methods"><a class="permalink" href="./Net::FTP.html#Object-Methods">#</a><a id="Object"></a>Object Methods</h2>

<p>Unless otherwise stated all methods return either a <i>true</i> or <i>false</i> value, with <i>true</i> meaning that the operation was a success. When a method states that it returns a value, failure will be returned as <i>undef</i> or an empty list.</p>

<p><code>Net::FTP</code> inherits from <code>Net::Cmd</code> so methods defined in <code>Net::Cmd</code> may be used to send commands to the remote FTP server in addition to the methods documented here.</p>

<dl>

<dt id="login([$login[,-$password[,-$account]]])"><a class="permalink" href="./Net::FTP.html#login(%5B$login%5B,-$password%5B,-$account%5D%5D%5D)">#</a><a id="login"></a><a id="login-login-password-account"></a><code>login([$login[, $password[, $account]]])</code></dt>
<dd>

<p>Log into the remote FTP server with the given login information. If no arguments are given then the <code>Net::FTP</code> uses the <code>Net::Netrc</code> package to lookup the login information for the connected host. If no information is found then a login of <i>anonymous</i> is used. If no password is given and the login is <i>anonymous</i> then <i>anonymous@</i> will be used for password.</p>

<p>If the connection is via a firewall then the <code>authorize</code> method will be called with no arguments.</p>

</dd>
<dt id="starttls()"><a class="permalink" href="./Net::FTP.html#starttls()">#</a><a id="starttls"></a><code>starttls()</code></dt>
<dd>

<p>Upgrade existing plain connection to SSL. The SSL arguments have to be given in <code>new</code> already because they are needed for data connections too.</p>

</dd>
<dt id="stoptls()"><a class="permalink" href="./Net::FTP.html#stoptls()">#</a><a id="stoptls"></a><code>stoptls()</code></dt>
<dd>

<p>Downgrade existing SSL connection back to plain. This is needed to work with some FTP helpers at firewalls, which need to see the PORT and PASV commands and responses to dynamically open the necessary ports. In this case <code>starttls</code> is usually only done to protect the authorization.</p>

</dd>
<dt id="prot($level)"><a class="permalink" href="./Net::FTP.html#prot($level)">#</a><a id="prot"></a><a id="prot-level"></a><code>prot($level)</code></dt>
<dd>

<p>Set what type of data channel protection the client and server will be using. Only <code>$level</code>s &quot;C&quot; (clear) and &quot;P&quot; (private) are supported.</p>

</dd>
<dt id="host()"><a class="permalink" href="./Net::FTP.html#host()">#</a><a id="host"></a><code>host()</code></dt>
<dd>

<p>Returns the value used by the constructor, and passed to the IO::Socket super class to connect to the host.</p>

</dd>
<dt id="account($acct)"><a class="permalink" href="./Net::FTP.html#account($acct)">#</a><a id="account"></a><a id="account-acct"></a><code>account($acct)</code></dt>
<dd>

<p>Set a string identifying the user&#39;s account.</p>

</dd>
<dt id="authorize([$auth[,-$resp]])"><a class="permalink" href="./Net::FTP.html#authorize(%5B$auth%5B,-$resp%5D%5D)">#</a><a id="authorize"></a><a id="authorize-auth-resp"></a><code>authorize([$auth[, $resp]])</code></dt>
<dd>

<p>This is a protocol used by some firewall ftp proxies. It is used to authorise the user to send data out. If both arguments are not specified then <code>authorize</code> uses <code>Net::Netrc</code> to do a lookup.</p>

</dd>
<dt id="site($args)"><a class="permalink" href="./Net::FTP.html#site($args)">#</a><a id="site"></a><a id="site-args"></a><code>site($args)</code></dt>
<dd>

<p>Send a SITE command to the remote server and wait for a response.</p>

<p>Returns most significant digit of the response code.</p>

</dd>
<dt id="ascii()"><a class="permalink" href="./Net::FTP.html#ascii()">#</a><a id="ascii"></a><code>ascii()</code></dt>
<dd>

<p>Transfer file in ASCII. CRLF translation will be done if required</p>

</dd>
<dt id="binary()"><a class="permalink" href="./Net::FTP.html#binary()">#</a><a id="binary"></a><code>binary()</code></dt>
<dd>

<p>Transfer file in binary mode. No transformation will be done.</p>

<p><b>Hint</b>: If both server and client machines use the same line ending for text files, then it will be faster to transfer all files in binary mode.</p>

</dd>
<dt id="type([$type])"><a class="permalink" href="./Net::FTP.html#type(%5B$type%5D)">#</a><a id="type"></a><a id="type-type"></a><code>type([$type])</code></dt>
<dd>

<p>Set or get if files will be transferred in ASCII or binary mode.</p>

</dd>
<dt id="rename($oldname,-$newname)"><a class="permalink" href="./Net::FTP.html#rename($oldname,-$newname)">#</a><a id="rename"></a><a id="rename-oldname-newname"></a><code>rename($oldname, $newname)</code></dt>
<dd>

<p>Rename a file on the remote FTP server from <code>$oldname</code> to <code>$newname</code>. This is done by sending the RNFR and RNTO commands.</p>

</dd>
<dt id="delete($filename)"><a class="permalink" href="./Net::FTP.html#delete($filename)">#</a><a id="delete"></a><a id="delete-filename"></a><code>delete($filename)</code></dt>
<dd>

<p>Send a request to the server to delete <code>$filename</code>.</p>

</dd>
<dt id="cwd([$dir])"><a class="permalink" href="./Net::FTP.html#cwd(%5B$dir%5D)">#</a><a id="cwd"></a><a id="cwd-dir"></a><code>cwd([$dir])</code></dt>
<dd>

<p>Attempt to change directory to the directory given in <code>$dir</code>. If <code>$dir</code> is <code>&quot;..&quot;</code>, the FTP <code>CDUP</code> command is used to attempt to move up one directory. If no directory is given then an attempt is made to change the directory to the root directory.</p>

</dd>
<dt id="cdup()"><a class="permalink" href="./Net::FTP.html#cdup()">#</a><a id="cdup"></a><code>cdup()</code></dt>
<dd>

<p>Change directory to the parent of the current directory.</p>

</dd>
<dt id="passive([$passive])"><a class="permalink" href="./Net::FTP.html#passive(%5B$passive%5D)">#</a><a id="passive"></a><a id="passive-passive"></a><code>passive([$passive])</code></dt>
<dd>

<p>Set or get if data connections will be initiated in passive mode.</p>

</dd>
<dt id="pwd()"><a class="permalink" href="./Net::FTP.html#pwd()">#</a><a id="pwd"></a><code>pwd()</code></dt>
<dd>

<p>Returns the full pathname of the current directory.</p>

</dd>
<dt id="restart($where)"><a class="permalink" href="./Net::FTP.html#restart($where)">#</a><a id="restart"></a><a id="restart-where"></a><code>restart($where)</code></dt>
<dd>

<p>Set the byte offset at which to begin the next data transfer. Net::FTP simply records this value and uses it when during the next data transfer. For this reason this method will not return an error, but setting it may cause a subsequent data transfer to fail.</p>

</dd>
<dt id="rmdir($dir[,-$recurse])"><a class="permalink" href="./Net::FTP.html#rmdir($dir%5B,-$recurse%5D)">#</a><a id="rmdir"></a><a id="rmdir-dir-recurse"></a><code>rmdir($dir[, $recurse])</code></dt>
<dd>

<p>Remove the directory with the name <code>$dir</code>. If <code>$recurse</code> is <i>true</i> then <code>rmdir</code> will attempt to delete everything inside the directory.</p>

</dd>
<dt id="mkdir($dir[,-$recurse])"><a class="permalink" href="./Net::FTP.html#mkdir($dir%5B,-$recurse%5D)">#</a><a id="mkdir"></a><a id="mkdir-dir-recurse"></a><code>mkdir($dir[, $recurse])</code></dt>
<dd>

<p>Create a new directory with the name <code>$dir</code>. If <code>$recurse</code> is <i>true</i> then <code>mkdir</code> will attempt to create all the directories in the given path.</p>

<p>Returns the full pathname to the new directory.</p>

</dd>
<dt id="alloc($size[,-$record_size])"><a class="permalink" href="./Net::FTP.html#alloc($size%5B,-$record_size%5D)">#</a><a id="alloc"></a><a id="alloc-size-record_size"></a><code>alloc($size[, $record_size])</code></dt>
<dd>

<p>The alloc command allows you to give the ftp server a hint about the size of the file about to be transferred using the ALLO ftp command. Some storage systems use this to make intelligent decisions about how to store the file. The <code>$size</code> argument represents the size of the file in bytes. The <code>$record_size</code> argument indicates a maximum record or page size for files sent with a record or page structure.</p>

<p>The size of the file will be determined, and sent to the server automatically for normal files so that this method need only be called if you are transferring data from a socket, named pipe, or other stream not associated with a normal file.</p>

</dd>
<dt id="ls([$dir])"><a class="permalink" href="./Net::FTP.html#ls(%5B$dir%5D)">#</a><a id="ls"></a><a id="ls-dir"></a><code>ls([$dir])</code></dt>
<dd>

<p>Get a directory listing of <code>$dir</code>, or the current directory.</p>

<p>In an array context, returns a list of lines returned from the server. In a scalar context, returns a reference to a list.</p>

</dd>
<dt id="dir([$dir])"><a class="permalink" href="./Net::FTP.html#dir(%5B$dir%5D)">#</a><a id="dir"></a><a id="dir-dir"></a><code>dir([$dir])</code></dt>
<dd>

<p>Get a directory listing of <code>$dir</code>, or the current directory in long format.</p>

<p>In an array context, returns a list of lines returned from the server. In a scalar context, returns a reference to a list.</p>

</dd>
<dt id="get($remote_file[,-$local_file[,-$where]])"><a class="permalink" href="./Net::FTP.html#get($remote_file%5B,-$local_file%5B,-$where%5D%5D)">#</a><a id="get"></a><a id="get-remote_file-local_file-where"></a><code>get($remote_file[, $local_file[, $where]])</code></dt>
<dd>

<p>Get <code>$remote_file</code> from the server and store locally. <code>$local_file</code> may be a filename or a filehandle. If not specified, the file will be stored in the current directory with the same leafname as the remote file.</p>

<p>If <code>$where</code> is given then the first <code>$where</code> bytes of the file will not be transferred, and the remaining bytes will be appended to the local file if it already exists.</p>

<p>Returns <code>$local_file</code>, or the generated local file name if <code>$local_file</code> is not given. If an error was encountered undef is returned.</p>

</dd>
<dt id="put($local_file[,-$remote_file])"><a class="permalink" href="./Net::FTP.html#put($local_file%5B,-$remote_file%5D)">#</a><a id="put"></a><a id="put-local_file-remote_file"></a><code>put($local_file[, $remote_file])</code></dt>
<dd>

<p>Put a file on the remote server. <code>$local_file</code> may be a name or a filehandle. If <code>$local_file</code> is a filehandle then <code>$remote_file</code> must be specified. If <code>$remote_file</code> is not specified then the file will be stored in the current directory with the same leafname as <code>$local_file</code>.</p>

<p>Returns <code>$remote_file</code>, or the generated remote filename if <code>$remote_file</code> is not given.</p>

<p><b>NOTE</b>: If for some reason the transfer does not complete and an error is returned then the contents that had been transferred will not be remove automatically.</p>

</dd>
<dt id="put_unique($local_file[,-$remote_file])"><a class="permalink" href="./Net::FTP.html#put_unique($local_file%5B,-$remote_file%5D)">#</a><a id="put_unique"></a><a id="put_unique-local_file-remote_file"></a><code>put_unique($local_file[, $remote_file])</code></dt>
<dd>

<p>Same as put but uses the <code>STOU</code> command.</p>

<p>Returns the name of the file on the server.</p>

</dd>
<dt id="append($local_file[,-$remote_file])"><a class="permalink" href="./Net::FTP.html#append($local_file%5B,-$remote_file%5D)">#</a><a id="append"></a><a id="append-local_file-remote_file"></a><code>append($local_file[, $remote_file])</code></dt>
<dd>

<p>Same as put but appends to the file on the remote server.</p>

<p>Returns <code>$remote_file</code>, or the generated remote filename if <code>$remote_file</code> is not given.</p>

</dd>
<dt id="unique_name()"><a class="permalink" href="./Net::FTP.html#unique_name()">#</a><a id="unique_name"></a><code>unique_name()</code></dt>
<dd>

<p>Returns the name of the last file stored on the server using the <code>STOU</code> command.</p>

</dd>
<dt id="mdtm($file)"><a class="permalink" href="./Net::FTP.html#mdtm($file)">#</a><a id="mdtm"></a><a id="mdtm-file"></a><code>mdtm($file)</code></dt>
<dd>

<p>Returns the <i>modification time</i> of the given file</p>

</dd>
<dt id="size($file)"><a class="permalink" href="./Net::FTP.html#size($file)">#</a><a id="size"></a><a id="size-file"></a><code>size($file)</code></dt>
<dd>

<p>Returns the size in bytes for the given file as stored on the remote server.</p>

<p><b>NOTE</b>: The size reported is the size of the stored file on the remote server. If the file is subsequently transferred from the server in ASCII mode and the remote server and local machine have different ideas about &quot;End Of Line&quot; then the size of file on the local machine after transfer may be different.</p>

</dd>
<dt id="supported($cmd)"><a class="permalink" href="./Net::FTP.html#supported($cmd)">#</a><a id="supported"></a><a id="supported-cmd"></a><code>supported($cmd)</code></dt>
<dd>

<p>Returns TRUE if the remote server supports the given command.</p>

</dd>
<dt id="hash([$filehandle_glob_ref[,-$bytes_per_hash_mark]])"><a class="permalink" href="./Net::FTP.html#hash(%5B$filehandle_glob_ref%5B,-$bytes_per_hash_mark%5D%5D)">#</a><a id="hash"></a><a id="hash-filehandle_glob_ref-bytes_per_hash_mark"></a><code>hash([$filehandle_glob_ref[, $bytes_per_hash_mark]])</code></dt>
<dd>

<p>Called without parameters, or with the first argument false, hash marks are suppressed. If the first argument is true but not a reference to a file handle glob, then \*STDERR is used. The second argument is the number of bytes per hash mark printed, and defaults to 1024. In all cases the return value is a reference to an array of two: the filehandle glob reference and the bytes per hash mark.</p>

</dd>
<dt id="feature($name)"><a class="permalink" href="./Net::FTP.html#feature($name)">#</a><a id="feature"></a><a id="feature-name"></a><code>feature($name)</code></dt>
<dd>

<p>Determine if the server supports the specified feature. The return value is a list of lines the server responded with to describe the options that it supports for the given feature. If the feature is unsupported then the empty list is returned.</p>

<pre><code>if ($ftp-&gt;feature( &#39;MDTM&#39; )) {
  # Do something
}

if (grep { /\bTLS\b/ } $ftp-&gt;feature(&#39;AUTH&#39;)) {
  # Server supports TLS
}</code></pre>

</dd>
</dl>

<p>The following methods can return different results depending on how they are called. If the user explicitly calls either of the <code>pasv</code> or <code>port</code> methods then these methods will return a <i>true</i> or <i>false</i> value. If the user does not call either of these methods then the result will be a reference to a <code>Net::FTP::dataconn</code> based object.</p>

<dl>

<dt id="nlst([$dir])"><a class="permalink" href="./Net::FTP.html#nlst(%5B$dir%5D)">#</a><a id="nlst"></a><a id="nlst-dir"></a><code>nlst([$dir])</code></dt>
<dd>

<p>Send an <code>NLST</code> command to the server, with an optional parameter.</p>

</dd>
<dt id="list([$dir])"><a class="permalink" href="./Net::FTP.html#list(%5B$dir%5D)">#</a><a id="list"></a><a id="list-dir"></a><code>list([$dir])</code></dt>
<dd>

<p>Same as <code>nlst</code> but using the <code>LIST</code> command</p>

</dd>
<dt id="retr($file)"><a class="permalink" href="./Net::FTP.html#retr($file)">#</a><a id="retr"></a><a id="retr-file"></a><code>retr($file)</code></dt>
<dd>

<p>Begin the retrieval of a file called <code>$file</code> from the remote server.</p>

</dd>
<dt id="stor($file)"><a class="permalink" href="./Net::FTP.html#stor($file)">#</a><a id="stor"></a><a id="stor-file"></a><code>stor($file)</code></dt>
<dd>

<p>Tell the server that you wish to store a file. <code>$file</code> is the name of the new file that should be created.</p>

</dd>
<dt id="stou($file)"><a class="permalink" href="./Net::FTP.html#stou($file)">#</a><a id="stou"></a><a id="stou-file"></a><code>stou($file)</code></dt>
<dd>

<p>Same as <code>stor</code> but using the <code>STOU</code> command. The name of the unique file which was created on the server will be available via the <code>unique_name</code> method after the data connection has been closed.</p>

</dd>
<dt id="appe($file)"><a class="permalink" href="./Net::FTP.html#appe($file)">#</a><a id="appe"></a><a id="appe-file"></a><code>appe($file)</code></dt>
<dd>

<p>Tell the server that we want to append some data to the end of a file called <code>$file</code>. If this file does not exist then create it.</p>

</dd>
</dl>

<p>If for some reason you want to have complete control over the data connection, this includes generating it and calling the <code>response</code> method when required, then the user can use these methods to do so.</p>

<p>However calling these methods only affects the use of the methods above that can return a data connection. They have no effect on methods <code>get</code>, <code>put</code>, <code>put_unique</code> and those that do not require data connections.</p>

<dl>

<dt id="port([$port])"><a class="permalink" href="./Net::FTP.html#port(%5B$port%5D)">#</a><a id="port"></a><a id="port-port"></a><code>port([$port])</code></dt>
<dd>

</dd>
<dt id="eprt([$port])"><a class="permalink" href="./Net::FTP.html#eprt(%5B$port%5D)">#</a><a id="eprt"></a><a id="eprt-port"></a><code>eprt([$port])</code></dt>
<dd>

<p>Send a <code>PORT</code> (IPv4) or <code>EPRT</code> (IPv6) command to the server. If <code>$port</code> is specified then it is sent to the server. If not, then a listen socket is created and the correct information sent to the server.</p>

</dd>
<dt id="pasv()"><a class="permalink" href="./Net::FTP.html#pasv()">#</a><a id="pasv"></a><code>pasv()</code></dt>
<dd>

</dd>
<dt id="epsv()"><a class="permalink" href="./Net::FTP.html#epsv()">#</a><a id="epsv"></a><code>epsv()</code></dt>
<dd>

<p>Tell the server to go into passive mode (<code>pasv</code> for IPv4, <code>epsv</code> for IPv6). Returns the text that represents the port on which the server is listening, this text is in a suitable form to send to another ftp server using the <code>port</code> or <code>eprt</code> method.</p>

</dd>
</dl>

<p>The following methods can be used to transfer files between two remote servers, providing that these two servers can connect directly to each other.</p>

<dl>

<dt id="pasv_xfer($src_file,-$dest_server[,-$dest_file-])"><a class="permalink" href="./Net::FTP.html#pasv_xfer($src_file,-$dest_server%5B,-$dest_file-%5D)">#</a><a id="pasv_xfer"></a><a id="pasv_xfer-src_file-dest_server-dest_file"></a><code>pasv_xfer($src_file, $dest_server[, $dest_file ])</code></dt>
<dd>

<p>This method will do a file transfer between two remote ftp servers. If <code>$dest_file</code> is omitted then the leaf name of <code>$src_file</code> will be used.</p>

</dd>
<dt id="pasv_xfer_unique($src_file,-$dest_server[,-$dest_file-])"><a class="permalink" href="./Net::FTP.html#pasv_xfer_unique($src_file,-$dest_server%5B,-$dest_file-%5D)">#</a><a id="pasv_xfer_unique"></a><a id="pasv_xfer_unique-src_file-dest_server-dest_file"></a><code>pasv_xfer_unique($src_file, $dest_server[, $dest_file ])</code></dt>
<dd>

<p>Like <code>pasv_xfer</code> but the file is stored on the remote server using the STOU command.</p>

</dd>
<dt id="pasv_wait($non_pasv_server)"><a class="permalink" href="./Net::FTP.html#pasv_wait($non_pasv_server)">#</a><a id="pasv_wait"></a><a id="pasv_wait-non_pasv_server"></a><code>pasv_wait($non_pasv_server)</code></dt>
<dd>

<p>This method can be used to wait for a transfer to complete between a passive server and a non-passive server. The method should be called on the passive server with the <code>Net::FTP</code> object for the non-passive server passed as an argument.</p>

</dd>
<dt id="abort()"><a class="permalink" href="./Net::FTP.html#abort()">#</a><a id="abort"></a><code>abort()</code></dt>
<dd>

<p>Abort the current data transfer.</p>

</dd>
<dt id="quit()"><a class="permalink" href="./Net::FTP.html#quit()">#</a><a id="quit"></a><code>quit()</code></dt>
<dd>

<p>Send the QUIT command to the remote FTP server and close the socket connection.</p>

</dd>
</dl>

<h2 id="Methods-for-the-Adventurous"><a class="permalink" href="./Net::FTP.html#Methods-for-the-Adventurous">#</a><a id="Methods"></a>Methods for the Adventurous</h2>

<dl>

<dt id="quot($cmd[,-$args])"><a class="permalink" href="./Net::FTP.html#quot($cmd%5B,-$args%5D)">#</a><a id="quot"></a><a id="quot-cmd-args"></a><code>quot($cmd[, $args])</code></dt>
<dd>

<p>Send a command, that Net::FTP does not directly support, to the remote server and wait for a response.</p>

<p>Returns most significant digit of the response code.</p>

<p><b>WARNING</b> This call should only be used on commands that do not require data connections. Misuse of this method can hang the connection.</p>

</dd>
<dt id="can_inet6()"><a class="permalink" href="./Net::FTP.html#can_inet6()">#</a><a id="can_inet6"></a><code>can_inet6()</code></dt>
<dd>

<p>Returns whether we can use IPv6.</p>

</dd>
<dt id="can_ssl()"><a class="permalink" href="./Net::FTP.html#can_ssl()">#</a><a id="can_ssl"></a><code>can_ssl()</code></dt>
<dd>

<p>Returns whether we can use SSL.</p>

</dd>
</dl>

<h2 id="The-dataconn-Class"><a class="permalink" href="./Net::FTP.html#The-dataconn-Class">#</a><a id="The"></a>The dataconn Class</h2>

<p>Some of the methods defined in <code>Net::FTP</code> return an object which will be derived from the <code>Net::FTP::dataconn</code> class. See <a href="./Net::FTP::dataconn.html">Net::FTP::dataconn</a> for more details.</p>

<h2 id="Unimplemented"><a class="permalink" href="./Net::FTP.html#Unimplemented">#</a>Unimplemented</h2>

<p>The following RFC959 commands have not been implemented:</p>

<dl>

<dt id="SMNT"><a class="permalink" href="./Net::FTP.html#SMNT">#</a><code>SMNT</code></dt>
<dd>

<p>Mount a different file system structure without changing login or accounting information.</p>

</dd>
<dt id="HELP"><a class="permalink" href="./Net::FTP.html#HELP">#</a><code>HELP</code></dt>
<dd>

<p>Ask the server for &quot;helpful information&quot; (that&#39;s what the RFC says) on the commands it accepts.</p>

</dd>
<dt id="MODE"><a class="permalink" href="./Net::FTP.html#MODE">#</a><code>MODE</code></dt>
<dd>

<p>Specifies transfer mode (stream, block or compressed) for file to be transferred.</p>

</dd>
<dt id="SYST"><a class="permalink" href="./Net::FTP.html#SYST">#</a><code>SYST</code></dt>
<dd>

<p>Request remote server system identification.</p>

</dd>
<dt id="STAT"><a class="permalink" href="./Net::FTP.html#STAT">#</a><code>STAT</code></dt>
<dd>

<p>Request remote server status.</p>

</dd>
<dt id="STRU"><a class="permalink" href="./Net::FTP.html#STRU">#</a><code>STRU</code></dt>
<dd>

<p>Specifies file structure for file to be transferred.</p>

</dd>
<dt id="REIN"><a class="permalink" href="./Net::FTP.html#REIN">#</a><code>REIN</code></dt>
<dd>

<p>Reinitialize the connection, flushing all I/O and account information.</p>

</dd>
</dl>

<h1 id="EXAMPLES"><a class="permalink" href="./Net::FTP.html#EXAMPLES">#</a>EXAMPLES</h1>

<p>For an example of the use of Net::FTP see</p>

<dl>

<dt id="https://www.csh.rit.edu/~adam/Progs/"><a class="permalink" href="./Net::FTP.html#https://www.csh.rit.edu/~adam/Progs/">#</a><a id="https"></a><a id="https:-www.csh.rit.edu-adam-Progs"></a><a href="https://www.csh.rit.edu/~adam/Progs/">https://www.csh.rit.edu/~adam/Progs/</a></dt>
<dd>

<p><code>autoftp</code> is a program that can retrieve, send, or list files via the FTP protocol in a non-interactive manner.</p>

</dd>
</dl>

<h1 id="EXPORTS"><a class="permalink" href="./Net::FTP.html#EXPORTS">#</a>EXPORTS</h1>

<p><i>None</i>.</p>

<h1 id="KNOWN-BUGS"><a class="permalink" href="./Net::FTP.html#KNOWN-BUGS">#</a><a id="KNOWN"></a>KNOWN BUGS</h1>

<p>See <a href="https://rt.cpan.org/Dist/Display.html?Status=Active&amp;Queue=libnet">https://rt.cpan.org/Dist/Display.html?Status=Active&amp;Queue=libnet</a>.</p>

<h2 id="Reporting-Bugs"><a class="permalink" href="./Net::FTP.html#Reporting-Bugs">#</a><a id="Reporting"></a>Reporting Bugs</h2>

<p>When reporting bugs/problems please include as much information as possible. It may be difficult for me to reproduce the problem as almost every setup is different.</p>

<p>A small script which yields the problem will probably be of help. It would also be useful if this script was run with the extra options <code>Debug =&gt; 1</code> passed to the constructor, and the output sent with the bug report. If you cannot include a small script then please include a Debug trace from a run of your program which does yield the problem.</p>

<h1 id="SEE-ALSO"><a class="permalink" href="./Net::FTP.html#SEE-ALSO">#</a><a id="SEE"></a>SEE ALSO</h1>

<p><a href="./Net::Netrc.html">Net::Netrc</a>, <a href="./Net::Cmd.html">Net::Cmd</a>, <a href="./IO::Socket::SSL.html">IO::Socket::SSL</a>;</p>

<p><a href="http://man.he.net/man1/ftp">ftp(1)</a>, <a href="http://man.he.net/man8/ftpd">ftpd(8)</a>;</p>

<p><a href="https://www.ietf.org/rfc/rfc959.txt">https://www.ietf.org/rfc/rfc959.txt</a>, <a href="https://www.ietf.org/rfc/rfc2428.txt">https://www.ietf.org/rfc/rfc2428.txt</a>, <a href="https://www.ietf.org/rfc/rfc4217.txt">https://www.ietf.org/rfc/rfc4217.txt</a>.</p>

<h1 id="ACKNOWLEDGEMENTS"><a class="permalink" href="./Net::FTP.html#ACKNOWLEDGEMENTS">#</a>ACKNOWLEDGEMENTS</h1>

<p>Henry Gabryjelski &lt;<a href="mailto:henryg@WPI.EDU">henryg@WPI.EDU</a>&gt; - for the suggestion of creating directories recursively.</p>

<p>Nathan Torkington &lt;<a href="mailto:gnat@frii.com">gnat@frii.com</a>&gt; - for some input on the documentation.</p>

<p>Roderick Schertler &lt;<a href="mailto:roderick@gate.net">roderick@gate.net</a>&gt; - for various inputs</p>

<h1 id="AUTHOR"><a class="permalink" href="./Net::FTP.html#AUTHOR">#</a>AUTHOR</h1>

<p>Graham Barr &lt;<a href="mailto:gbarr@pobox.com">gbarr@pobox.com</a>&gt;.</p>

<p>Steve Hay &lt;<a href="mailto:shay@cpan.org">shay@cpan.org</a>&gt; is now maintaining libnet as of version 1.22_02.</p>

<h1 id="COPYRIGHT"><a class="permalink" href="./Net::FTP.html#COPYRIGHT">#</a>COPYRIGHT</h1>

<p>Copyright (C) 1995-2004 Graham Barr. All rights reserved.</p>

<p>Copyright (C) 2013-2017, 2020 Steve Hay. All rights reserved.</p>

<h1 id="LICENCE"><a class="permalink" href="./Net::FTP.html#LICENCE">#</a>LICENCE</h1>

<p>This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself, i.e. under the terms of either the GNU General Public License or the Artistic License, as specified in the <i>LICENCE</i> file.</p>

<h1 id="VERSION"><a class="permalink" href="./Net::FTP.html#VERSION">#</a>VERSION</h1>

<p>Version 3.13</p>

<h1 id="DATE"><a class="permalink" href="./Net::FTP.html#DATE">#</a>DATE</h1>

<p>23 Dec 2020</p>

<h1 id="HISTORY"><a class="permalink" href="./Net::FTP.html#HISTORY">#</a>HISTORY</h1>

<p>See the <i>Changes</i> file.</p>


      </div>
      <div id="footer">
        <p>Perldoc Browser is maintained by Dan Book (<a href="https://metacpan.org/author/DBOOK">DBOOK</a>). Please contact him via the <a href="https://github.com/Grinnz/perldoc-browser/issues">GitHub issue tracker</a> or <a href="mailto:dbook@cpan.org">email</a> regarding any issues with the site itself, search, or rendering of documentation.</p>

<p>The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the <a href="https://github.com/Perl/perl5/issues">Perl issue tracker</a>, the <a href="https://lists.perl.org/list/perl5-porters.html">mailing list</a>, or <a href="https://kiwiirc.com/client/irc.perl.org/p5p">IRC</a> to report any issues with the contents or format of the documentation.</p>


      </div>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" integrity="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw==" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
    <script src="../highlight.pack.js"></script>
    <script>hljs.highlightAll();</script>
  </body>
</html>
